<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <title>CMS后台管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <link th:replace="resource :: css" rel="stylesheet"/>
</head>
<body>
<div class="container-fluid">
    <form class="form-horizontal" role="form" action="update" method="post">
        <input type="hidden" name="id" value="$!entity.id">
        <div class="form-group">
            <label class="col-sm-2 control-label">栏目</label>
            <div class="col-sm-10">
                <select class="form-control" name="channel.id">
                    #foreach($e in $!channels)
                        <option value="$!e.id" #if($!e.id == $!entity.channel.id) selected #end>$!e.name</option>
                    #end
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">可浏览用户</label>
            <div class="col-sm-10">
                <select class="form-control" name="groupId">
                    #foreach($e in $!groups)
                        <option value="$!e.id" #if($!e.id == $!entity.groupId) selected #end>$!e.name</option>
                    #end
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">状态</label>
            <div class="col-sm-10">
                <select class="form-control" name="userState">
                    #foreach($e in $!checkStates)
                        <option value="$!e" #if($!e == $!entity.userState) selected #end>$!e.name</option>
                    #end
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">推荐级别</label>
            <div class="col-sm-10">
                <select class="form-control" name="recommendLevel">
                    #set($nums=[0 .. 3])
                    #foreach($e in $!nums)
                        <option value="$!e" #if($!e == $!entity.recommendLevel) selected #end>$!e</option>
                    #end
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">允许评论</label>
            <div class="col-sm-10">
                <input type="checkbox" class="tfbox" name="commentState" value="$!entity.commentState" #if($!entity.commentState)checked#end/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">标题</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" placeholder="" name="title" value="$!entity.title">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">作者</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" placeholder="" name="author" value="$!entity.author">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">发布时间</label>
            <div class="col-sm-10">
                <input type="text" class="form-control dateFormat" placeholder="" name="releaseDate" value="$!entity.releaseDate">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">来源</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" placeholder="" name="origin" value="$!entity.origin">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">标题缩略图</label>
            <div class="col-sm-10">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="" name="titleImg" id="titleImg" value="$!entity.titleImg">
                    <a href="javascript:void(0);" class="input-group-addon previewImg" target-id="titleImg">预览</a>
                    <a href="javascript:void(0);" class="input-group-addon uploadImg" target-id="titleImg">上传</a>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">内容缩略图</label>
            <div class="col-sm-10">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="" name="contentImg" id="contentImg" value="$!entity.contentImg">
                    <a href="javascript:void(0);" class="input-group-addon previewImg" target-id="contentImg">预览</a>
                    <a href="javascript:void(0);" class="input-group-addon uploadImg" target-id="contentImg">上传</a>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">相关文章ID</label>
            <div class="col-sm-10">
                <input type="text" class="form-control" placeholder="" name="relatedId" value="$!entity.relatedId">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">摘要</label>
            <div class="col-sm-10">
                <textarea class="form-control" rows="2" name="summary">$!entity.summary</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">正文</label>
            <div class="col-sm-10">
                <textarea class="form-control" rows="5" name="content">$!entity.content</textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary">保存</button>
                <a class="btn btn-success" href="list">返回</a>
            </div>
        </div>
    </form>
</div>
    <script th:replace="resource :: js"></script>
    #include("commons/support-image.vm")
</body>
</html>